<?php 
// back page
include_once("../UserIncludes/DbConfig.php");
include_once("../UserIncludes/DataTables.php");

$str="";
if($_REQUEST['adgroup_runn']=='N')
{
	$update_run_adgroup="update adgroup set runn = 'Y' where adgroup_id = '".$_REQUEST['adgroup_id']."'";
	$str .="Running".":".$_REQUEST['adcamp_count_col'].":".$_REQUEST['adgroup_count_col'];
}
else
{
	$update_run_adgroup="update adgroup set runn = 'N' where adgroup_id = '".$_REQUEST['adgroup_id']."'";
	$str .="Paused".":".$_REQUEST['adcamp_count_col'].":".$_REQUEST['adgroup_count_col'];
}
mysql_query($update_run_adgroup);

$SQL_action_adgroup = "select * from adgroup where adgroup_id = '".$_REQUEST['adgroup_id']."'";
//echo $SQL_action;
$EXE_action_adgroup=mysql_query($SQL_action_adgroup);
$ROW_action_adgroup=mysql_fetch_array($EXE_action_adgroup);

$str .=":";
if($ROW_action_adgroup['runn']=='N')
{
	$str .= '<img src="images/icon-status-running.gif" align="middle" onclick="change_status_adgroup('.$_REQUEST['adgroup_id'].',\''.$ROW_action_adgroup['runn'].'\','.$_REQUEST['adcamp_count_col'].','.$_REQUEST['adgroup_count_col'].');">';

}
else
{
	$str .= '<img src="images/icon-status-paused.gif" align="middle" onclick="change_status_adgroup('.$_REQUEST['adgroup_id'].',\''.$ROW_action_adgroup['runn'].'\','.$_REQUEST['adcamp_count_col'].','.$_REQUEST['adgroup_count_col'].');">';

}

echo $str."^7";
//echo "^6";
?>
